package com.javaProject.entity;
import com.javaProject.service.impl.SM2;
import org.bouncycastle.crypto.engines.SM2Engine;
import org.bouncycastle.crypto.params.ECKeyParameters;
import org.bouncycastle.crypto.params.ECPrivateKeyParameters;
import org.bouncycastle.crypto.params.ParametersWithRandom;

import java.security.PrivateKey;
import java.security.interfaces.ECPrivateKey;

public class SM2Util {
    public static ECKeyParameters generatePrivateKeyParameters(PrivateKey privateKey) {
        ECPrivateKeyParameters privateKeyParameters = new ECPrivateKeyParameters(((ECPrivateKey) privateKey).getS(), SM2.domainsParams);
        return privateKeyParameters;
    }
}